<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_data_tables.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:01 GMT -->

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>对账接入者管理系统</title>
    <meta name="keywords" content="对账接入者管理系统">
    <meta name="description" content="对账接入者管理系统">

    <link rel="shortcut icon" href="{{asset('dealer/img/favicon.ico')}}">
    <link href="{{asset('dealer/css/bootstrap.min.css')}}" rel="stylesheet">
    <link href="{{asset('dealer/css/font-awesome.min.css')}}" rel="stylesheet">

    <!-- Data Tables -->
    <link href="{{asset('dealer/css/plugins/dataTables/dataTables.bootstrap.css')}}" rel="stylesheet">

    <link href="{{asset('dealer/css/animate.min.css')}}" rel="stylesheet">
    <link href="{{asset('dealer/css/style.min.css')}}" rel="stylesheet">

    <link href="{{asset('dealer/css/plugins/datapicker/datepicker3.css')}}" rel="stylesheet">

    <link rel="stylesheet" type="text/css" href="{{asset('layui-v2.3.0/layui/css/layui.css')}}" />
    <link href="{{asset('layui-v2.3.0/layui/css/layui.css')}}" rel="stylesheet">
{{--    <script src="{{asset('dealer/js/jquery.min.js')}}"></script>--}}
    <script type="text/javascript" src="{{asset('lib/jquery/1.9.1/jquery.min.js')}}"></script>
    <script type="text/javascript" src="{{asset('lib/layer/2.4/layer.js')}}"></script>
    <script src="{{asset('dealer/js/bootstrap.min.js')}}"></script>
    <script src="{{asset('dealer/js/plugins/jeditable/jquery.jeditable.js')}}"></script>
    <script src="{{asset('dealer/js/plugins/dataTables/jquery.dataTables.js')}}"></script>
    <script src="{{asset('dealer/js/plugins/dataTables/dataTables.bootstrap.js')}}"></script>
    <script src="{{asset('dealer/js/content.min.js')}}"></script>


    <script  src="{{asset('lib/laypage/1.2/laypage.js')}}"></script>


    <script src="{{asset('laydate/laydate.js')}}"></script>

    <script  src="{{asset('layui/src/layui.js')}}"></script>

    <script src="{{asset('layui-v2.3.0/layui/layui.js')}}"></script>
</head>

<body class="gray-bg">
<style>
    table.dataTable thead .sorting:after {
        content: "";
    }

    table.dataTable,
    .table-bordered {
        text-align: center;
    }
</style>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-3">
            <div class="input-group">
                <input type="text" placeholder="公司名称" id="like" class="input-sm form-control" style="margin-left:0 ">
                <span class="input-group-btn">
                        <button type="button" class="btn btn-sm btn-primary" id="searchkey"> 搜索</button>
                    </span>
            </div>
        </div>
        <div class="col-sm-2 m-b-xs">
        </div>
        <div class="col-sm-5 m-b-xs" style="width: 45%">
            <div class="input-group">
                <span class="input-group-addon">时间段：</span>
                <input type="text" placeholder="请选择日期" class="input-sm form-control" style="margin-left:0; " id="datetime">
                <span class="input-group-addon">到</span>
                <input type="text" placeholder="请选择日期" class="input-sm form-control" style="margin-left:0;" id="datetime1">
                <span class="input-group-btn">
<button type="button" class="btn btn-sm btn-primary"  id="searchBlist"> 搜索</button>
</span>
            </div>




        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>推荐用户管理</h5>
                </div>
                <div class="ibox-content">
                    <div class="row" style="margin-bottom: 5px">
                        <!--
                         <div class="col-sm-6">
                            <strong>熊宝宝</strong>
                        </div>
                        <div class="col-sm-6">
                            <strong style="float: right;font-size: 20px">剩余金额：
                                <span id="" style="font-size: 20px">4800</span>元</strong>
                        </div>
                        !-->
                    </div>
                    <table class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                        <tr>
                            <th style="text-align: center;">
                                <strong>序号</strong>
                            </th>
                            <th style="text-align: center;">
                                <strong>公司名称</strong>
                            </th>
                            <th style="text-align: center;"  >
                                <strong>推荐时间</strong>
                            </th>
                        </tr>
                        </thead>
                        <tbody id="tbody-content">
                        {{--<tr>--}}
                            {{--<td class="center">1</td>--}}
                            {{--<td class="center">星宝宝xxxxx公司</td>--}}
                            {{--<td class="center">2018.05.29  11:11:12</td>--}}
                        {{--</tr>--}}

                        </tbody>
                    </table>
                    <div class="row">
                        <div id="pages" style="float: right;"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>




<script type="text/javascript">


    $(document).ready(function () {

        //两个日期范围选择
        layui.use(['laydate', 'jquery'], function () {
            var laydate = layui.laydate,
                $ = layui.jquery;
            var startIns = laydate.render({
                elem: '#datetime',
                max: 'new Date()',
                done: function (value, date, endDate) {
                    var min = $.extend({}, date),
                        max = $.extend({}, date);
                    min.month = min.month - 1;
                    max.month = max.month - 1;
                    //两个时间相差天数
                    var begintime = new Date().getTime();
                    var endtime = new Date(Date.parse(value)).getTime();
                    var nTime = begintime - endtime;
                    var day = Math.floor(nTime / 86400000);
                    max.date = max.date + day;

                    endIns.config.min = min;
                    endIns.config.max = max;
                    endIns.config.value = value;
                    $(endIns.config.elem).val(value);
                }
            });
            var endIns = laydate.render({
                elem: '#datetime1',
                min: 'value',
                done: function (value, date, endDate) {}
            });
        });

        var like=$('#like').val();
        var startDate=$('#datetime').val()
        var endDate=$('#datetime1').val()
        var sum = "";
        $.ajax({
            method: "POST",
            url: "B_list",
            data: {'rows': 10, 'page': 1,'_token':'{{csrf_token()}}','startDate':startDate,'endDate':endDate,'like':encodeURI(like)},
            async: false,
            dataType: "json",
            success:function (eval) {

                if ( eval.code == '200' ) {
                    sum = eval.data.total;

                } else if ( eval.code == '666' ) {
                    loginFaild();
                }
            }
        });

        layui.use('laypage', function(){
            var laypage = layui.laypage;
// console.log('sum55='+sum);
            //总页数大于页码总数

            laypage.render({
                elem: 'pages'
                ,count: sum //数据总数
                ,jump: function(obj){
                    // alert(obj.curr);
                    // console.log('sum66='+sum);
                    // console.log(obj.curr)
                    $.ajax({
                        method: "POST",
                        url: "B_list",
                        data: {'rows': 10, 'page': obj.curr,'_token':'{{csrf_token()}}','startDate':startDate,'endDate':endDate,'like':encodeURI(like)  },
                        // async: false,
                        dataType: "json",
                        success:function (eval) {

                            if ( eval.code == '200' ) {
                                $('#tbody-content').html("");
                                $.each(eval.data.records, function (index, item) {
                                    var html = '<tr >\n' +
                                        '                <td class="center">' + parseInt(index+1) + '</td>\n' +
                                        '                <td class="center">\n' +
                                        '                    <span>' + item.corporateName + '</span>\n' +
                                        '                </td>\n' +
                                        '                <td class="center">' + item.createDate + ' </td>\n' +
                                        '            </tr>';
                                    $('#tbody-content').append(html);
                                });
                            }
                        }
                    });
                }
            });
        });

        $('#searchkey').on('click', function () {



            var like=$('#like').val();

            var sum = "";
            $.ajax({
                method: "POST",
                url: "B_list",
                data: {'rows': 10, 'page': 1,'_token':'{{csrf_token()}}','like':encodeURI(like)},
                async: false,
                dataType: "json",
                success:function (eval) {

                    if ( eval.code == '200' ) {
                        sum = eval.data.total;

                    } else if ( eval.code == '666' ) {
                        loginFaild();
                    }
                }
            });



            layui.use('laypage', function(){
                var laypage = layui.laypage;
                var status = "";
                //总页数大于页码总数
                laypage.render({
                    elem: 'pages'
                    ,count: sum //数据总数
                    ,jump: function(obj){

                        $.ajax({
                            method: "POST",
                            url: "B_list",
                            data: {"rows": 10, "page": obj.curr ,'_token':'{{csrf_token()}}', "like": encodeURI(like)},
                            dataType: "json",
                            success:function (eval) {
                                if ( eval.code == '200' ) {
                                    $('#tbody-content').html("");
                                    $.each(eval.data.records, function (index, item) {

                                        var html = '<tr >\n' +
                                            '                <td class="center">' + parseInt(index+1) + '</td>\n' +
                                            '                <td class="center">\n' +
                                            '                    <span>' + item.corporateName + '</span>\n' +
                                            '                </td>\n' +
                                            '                <td class="center">' + item.createDate + ' </td>\n' +
                                            '            </tr>';
                                        $('#tbody-content').append(html);
                                    });
                                }
                            }
                        });
                    }
                });
            });




        })


//时间搜索


            $('#searchBlist').on('click', function () {

                var startDate=$('#datetime').val()
                var endDate=$('#datetime1').val()
                var sum = "";

                $.ajax({
                    method: "POST",
                    url: "B_list",
                    data: {'rows': 10, 'page': 1,'_token':'{{csrf_token()}}','startDate':startDate,'endDate':endDate},
                    async: false,
                    dataType: "json",
                    success:function (eval) {

                        if ( eval.code == '200' ) {
                            sum = eval.data.total;

                        } else if ( eval.code == '666' ) {
                            loginFaild();
                        }
                    }
                });






            // alert(startDate)
            // alert(endDate)

            if(!startDate||!endDate){

                layui.use(['layer', 'form'], function(){
                    var layer = layui.layer;

                    layer.msg('请选择起止时间');
                });
                return false;
            }

            layui.use('laypage', function(){
                var laypage = layui.laypage;
                var status = "";
                //总页数大于页码总数
                laypage.render({
                    elem: 'pages'
                    ,count: sum //数据总数
                    ,jump: function(obj){
                        $.ajax({
                            method: "POST",
                            url: "B_list",
                            data: {"rows": 10, "page": obj.curr ,'_token':'{{csrf_token()}}', "startDate": startDate, "endDate": endDate},
                            dataType: "json",
                            success:function (eval) {
                                if ( eval.code == '200' ) {
                                    $('#tbody-content').html("");
                                    $.each(eval.data.records, function (index, item) {

                                        var html = '<tr >\n' +
                                            '                <td class="center">' + parseInt(index+1) + '</td>\n' +
                                            '                <td class="center">\n' +
                                            '                    <span>' + item.corporateName + '</span>\n' +
                                            '                </td>\n' +
                                            '                <td class="center">' + item.createDate + ' </td>\n' +
                                            '            </tr>';
                                        $('#tbody-content').append(html);
                                    });
                                }
                            }
                        });
                    }
                });
            });


            })





    })


    function loginFaild() {
        // layer.msg({content: "登陆信息失效", time: 2});
        alert('登录失效')
        var t = setInterval(function () {
            window.location.href="login";
            clearInterval(t);
        }, 2000);
    }








</script>


</body>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_data_tables.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:02 GMT -->

</html>